package com.ls.atf.core;

import static com.ls.atf.core.DriverMaster.getDriver;

import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;

import com.ls.atf.data.UserData;
import com.ls.atf.utils.ConfigProperties;

public abstract class TestBase {

	protected WebDriver driver;
	
	protected String registrationEmail = ConfigProperties.getAppProperties("autRegistrationEmail");
	
	protected UserData user = new UserData()
	.setEmail(ConfigProperties.getDataProperties("manager.email"))
	.setDisplayName(ConfigProperties.getDataProperties("manager.displayName"))
	.setPassword(ConfigProperties.getDataProperties("manager.password"))
	.setBio(ConfigProperties.getDataProperties("manager.bio"));
	
	protected UserData mailUser = new UserData()
	.setEmail(ConfigProperties.getDataProperties("mailbox.email"))
	.setPassword(ConfigProperties.getDataProperties("mailbox.pass"));

	@BeforeSuite(alwaysRun = true)
	@Parameters({ "browser" })
	public void setUp(@Optional("firefox") String browser) {
		driver = getDriver(browser);
	}

	@AfterSuite(alwaysRun = true)
	public void tearDown() {
		driver.quit();
	}

}
